package com.example.changephoto;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;

public class BigImageActivity extends Activity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_big_image);
        ImageView iv =(ImageView)findViewById(R.id.c42bigIV);
        Intent intent =this.getIntent();
        iv.setImageBitmap(getBitmap(intent.getExtras().getByteArray("bigImage")));
        iv.setOnClickListener( new OnClickListener(){
            @Override
            public void onClick(View arg0) {
                finish();
            }
        });
    }
    /**根据字节数组，转换成bitmap对象*/
    public  Bitmap getBitmap(byte[] data){
        return BitmapFactory.decodeByteArray(data, 0, data.length);
    }
}